<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/4/12
 * Time: 16:03
 */
$client = stream_socket_client('tcp://127.0.0.1:9001');

while (true) {
    echo '===>  准备发送信息'.PHP_EOL;

    fwrite($client, 'hello world');

    echo '===>  发送信息成功'.PHP_EOL;

    var_dump(fread($client, 65535));
}